/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.nlp.visualization.pojo.weibo;

import java.io.Serializable;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author LXM
 */
@Entity
@Table(name = "t_weibo_follow")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "TWeiboFollow.findAll", query = "SELECT t FROM TWeiboFollow t"),
    @NamedQuery(name = "TWeiboFollow.findByUserId", query = "SELECT t FROM TWeiboFollow t WHERE t.tWeiboFollowPK.userId = :userId"),
    @NamedQuery(name = "TWeiboFollow.findByFollowId", query = "SELECT t FROM TWeiboFollow t WHERE t.tWeiboFollowPK.followId = :followId")})
public class TWeiboFollow implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TWeiboFollowPK tWeiboFollowPK;

    public TWeiboFollow() {
    }

    public TWeiboFollow(TWeiboFollowPK tWeiboFollowPK) {
        this.tWeiboFollowPK = tWeiboFollowPK;
    }

    public TWeiboFollow(String userId, String followId) {
        this.tWeiboFollowPK = new TWeiboFollowPK(userId, followId);
    }

    public TWeiboFollowPK getTWeiboFollowPK() {
        return tWeiboFollowPK;
    }

    public void setTWeiboFollowPK(TWeiboFollowPK tWeiboFollowPK) {
        this.tWeiboFollowPK = tWeiboFollowPK;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (tWeiboFollowPK != null ? tWeiboFollowPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TWeiboFollow)) {
            return false;
        }
        TWeiboFollow other = (TWeiboFollow) object;
        if ((this.tWeiboFollowPK == null && other.tWeiboFollowPK != null) || (this.tWeiboFollowPK != null && !this.tWeiboFollowPK.equals(other.tWeiboFollowPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "dao.TWeiboFollow[ tWeiboFollowPK=" + tWeiboFollowPK + " ]";
    }
    
}
